package com.saac.imf.service;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@RocketMQMessageListener(topic = "TopicTest", consumerGroup = "my-consumer-group")
public class MyMessageListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println("Received message: " + message);
    }

    @PostConstruct
    public void init() {
        System.out.println("MyMessageListener initialized and ready to consume messages.");
    }
}
